package com.wang.book.entity;

import lombok.Data;

/**
 * @author Sun.chuanwang
 * @version 1.0.0
 * @date 2021/6/14 16:39
 */
@Data
public class Result {
    private String code;
    private String message;
    private Object data;


    private Result(String code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public static Result ok(){
        return new Result("200","操作成功",null);
    }

    public static Result ok(Object result){
        return new Result("200","操作成功",result);
    }

    public static Result error(){
        return new Result("400","操作失败",null);
    }
}
